<template>
  <view class="home-container">
    <view class="welcome">欢迎来到校园宿舍零食小程序！</view>
    <swiper class="banner" indicator-dots="true" autoplay="true" interval="3000" duration="500">
      <swiper-item>
        <image src="/static/imgs/snacks/laopo_bing.jpg" class="banner-img" mode="aspectFill" />
      </swiper-item>
      <swiper-item>
        <image src="/static/imgs/snacks/wu_gu_ji_zhua.jpg" class="banner-img" mode="aspectFill" />
      </swiper-item>
      <swiper-item>
        <image src="/static/imgs/snacks/yi_gen_chong.jpg" class="banner-img" mode="aspectFill" />
      </swiper-item>
    </swiper>
    <view class="quick-order">
      <button type="primary" @click="goProduct">立即下单</button>
    </view>
  </view>
</template>
<script>
export default {
  name: 'Home',
  methods: {
    goProduct() {
      uni.switchTab({ url: '/pages/product/product' })
    }
  }
}
</script>
<style>
.home-container { padding: 20rpx; }
.welcome { font-size: 36rpx; font-weight: bold; margin-bottom: 20rpx; text-align: center; }
.banner { width: 100%; height: 300rpx; margin-bottom: 20rpx; }
.banner-img { width: 100%; height: 100%; border-radius: 12rpx; }
.quick-order { text-align: center; margin-top: 30rpx; }
</style> 